<template>
    <div>
        <MainComment
            v-for="(comment, index) in commentList"
            :key="index"
            :commentData="comment"
        />
    </div>
</template>

<script>
    import MainComment from '@/components/test/MainComment'
    export default {
        components: {
            MainComment
        },
        // 评论应该是一个数组, 里面每个对象都是一条评论
        // 最重要的数据是评论里面的主要内容 content
        data() {
            return {
                commentList: [
                    {
                        content: "楼主说的有道理",
                    },
                    {
                        content: "挽尊",
                    },
                    {
                        content: "从前有座山",
                    },
                    {
                        content: "+10086",
                    },
                    // 如果是回复别人, 就会把被回复的评论放在 parent 里面
                    {
                        content: "山上有座庙",
                        parent: {
                            content: "从前有座山",
                        },
                    },
                    {
                        content: "葬爱家族万岁",
                    },
                    {
                        content: "庙里有个和尚在讲故事",
                        parent: {
                            content: "山上有座庙",
                            parent: {
                                content: "从前有座山",
                            },
                        },
                    },
                ],
            };
        },
    };
</script>

<style>
</style>